Skip to content

Cannot find -lgcc_s: No such file or directory#1026

Merged
dunglas merged 2 commits into
php:mainfrom
goossda:bugfix/lgcc-s-issue
Sep 15, 2024
Merged

Cannot find -lgcc_s: No such file or directory#1026
dunglas merged 2 commits into
php:mainfrom
goossda:bugfix/lgcc-s-issue

Conversation

@goossda
Copy link
Copy Markdown
Contributor

@goossda goossda commented Sep 11, 2024

I have no idea why, but when building the static binary, i got the following error:

image

I did a build with:

docker buildx bake \
--load \
--set static-builder.args.PHP_VERSION="8.3" \
--set static-builder.args.PHP_EXTENSIONS="inotify,sodium,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,iconv,intl,ldap,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sqlite3,sysvsem,tokenizer,xml,xmlreader,xmlwriter,zip,zlib,amqp" \
--set static-builder.args.TARGETARCH="amd64" \
--set '*.platform=linux/amd64' \
static-builder
docker cp $(docker create --name static-builder dunglas/frankenphp:static-builder):/go/src/app/dist/frankenphp-linux-x86_64 ../../../dist/frankenphp; docker rm static-builder

I filtered "-lgcc_s" out of the CGO_LDFLAGS to get the compile running again.

Any idea what i did wrong? Or is it a very recent issue?

@dunglas
Copy link
Copy Markdown
Member

dunglas commented Sep 11, 2024

It would be cool to find which lib adds gcc_s as it's likely an upstream bug: https://gnu.gcc.help.narkive.com/pidFkujy/what-is-gcc-s-lib

In the meantime, your workaround looks good to me.

@dunglas dunglas mentioned this pull request Sep 15, 2024
@dunglas dunglas merged commit 6c0292a into php:main Sep 15, 2024
@dunglas
Copy link
Copy Markdown
Member

dunglas commented Sep 15, 2024

Thanks

@goossda goossda deleted the bugfix/lgcc-s-issue branch September 16, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants